package com.bnz.entity;

import io.mybatis.provider.Entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


@Data
@AllArgsConstructor
@NoArgsConstructor
// 指明表名
@Entity.Table("student")
public class Student implements Serializable {
    // 指定主键
    @Entity.Column(id = true,value = "sid",remark = "主键",updatable = false,insertable = false)
    // 这里必须为id
    // 或者private Integer sid;
    // public void getid(Integer sid){
    //    this.sid = sid; } 修改属性名为id
    private Integer id;
    @Entity.Column
    private String sname;
    @Entity.Column
    private String sex;
    @Entity.Column
    private Integer age;
    @Entity.Column
    private String addr;
    @Entity.Column
    private Integer cid;

//    @Transient // 不参与序列化（student表没有该字段）
    private String cname;

}